package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Customer;
import cn.wolfcode.crm.domain.Employee;
import cn.wolfcode.crm.query.CustomerQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CustomerMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Customer record);

    Customer selectByPrimaryKey(Long id);

    List<Customer> selectAll();

    int updateByPrimaryKey(Customer record);

    List<Customer> selectForList(CustomerQuery qo);

    //查询条件可以用IN字句的时候：用可变参数简单易维护
    List<Employee> selectByRoleSn(String ... sns);

    Customer selectByTel(String tel);

    Customer selectByQQ(String qq);

    String getTelById(Long id);

    String getQQById(Long id);

    void updateSeller(@Param("customerId") Long customerId, @Param("newSellerId") Long newSellerId);

    Integer[] selectByStatus();
}